package com.foreknow.elmboot.controller;

import com.foreknow.elmboot.po.User;
import com.foreknow.elmboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/UserController")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/getUserByIdByPass")
    public User getUserByIdByPass(String userId, String password) {
        User user = userService.getUseruserNamePassword(userId, password);
        return user;
    }

    @RequestMapping("/saveUser")
    public int saveUser(User user) {
        int aaa = userService.addUser(user);
        return aaa;
    }
}
